package com.example;

/**
 * @desc:
 * @author: Shoko
 * @date: 2025/5/25
 */
// 固定金额折扣策略
public class FixedAmountStrategy implements DiscountStrategy {
    private double amount;

    public FixedAmountStrategy(double amount) {
        this.amount = amount;
    }

    @Override
    public double calculate(double price) {
        return Math.max(0, price - amount); // 确保价格不为负
    }
}

